package com.right.health.app.net;

import android.text.TextUtils;

import com.magics.http.model.HttpParams;
import com.right.health.app.bean.DepartmentResponse;

import org.json.JSONException;
import org.json.JSONObject;

/*
 * Created by hopeliao on 2019-10-22
 *
 */
public class DeptApi extends IBaseApi {

    public void getDepartmentList(String syscommunitycode, String deptname) {
        HttpParams params = new HttpParams();
        try {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("deptname", deptname);

            if(!TextUtils.isEmpty(syscommunitycode)) {
                jsonObject.put("syscommunitycode", syscommunitycode);
            }
            params.addFormParam("jsonstr", jsonObject.toString());
        } catch (JSONException e) {
            e.printStackTrace();
        }
        doPostJson(HttpConstants.API_GET_DEPARTMEN, params, DepartmentResponse.class);
    }
}
